/**
 * @Project Name:hoofungson-studio
 * @Package Name:cn.hoofungson.studio.web.controller.rest.user
 * @Since JDK 1.8
 */
package cn.hoofungson.studio.web.controller.rest.user;

import cn.hoofungson.studio.core.domain.vo.UserVo;
import cn.hoofungson.studio.core.support.rest.response.RestPageResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 用户控制器
 * @Author 胡松 hoofungson@163.com
 * @Date 2018-03-07 10:33
 * @Version V1.0
 */
@RestController
@RequestMapping(value = "/rest/user")
public class RestUserController {

    @GetMapping
    public RestPageResponse<UserVo> getUsers(){
        RestPageResponse<UserVo> restPageResponse = new RestPageResponse<>();
        restPageResponse.setSuccess(true);
        restPageResponse.setState(20731L);
        restPageResponse.setMessage("查询成功！！");

        List<UserVo> userVos = new ArrayList<>();
        UserVo userVo = new UserVo();
        userVo.setId(25001L);
        userVo.setUsername("hoosung");
        userVo.setRealName("胡松");
        userVo.setSex("男");
        userVo.setEmail("hoofungson@163.com");
        userVos.add(userVo);

        restPageResponse.setResult(userVos);
        return restPageResponse;
    }
}
